package com.zzyk.main.mapper;

import com.zzyk.main.model.vo.EnterpriseTimeRule;
import com.zzyk.main.model.vo.OrganizationInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

import com.zzyk.main.model.pojo.TimeRule;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface TimeRuleMapper {
    /**
     * delete by primary key
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(TimeRule record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(TimeRule record);

    /**
     * select by primary key
     *
     * @param id primary key
     * @return object by primary key
     */
    TimeRule selectByPrimaryKey(Integer id);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(TimeRule record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(TimeRule record);

    /**
     * 查询全部信息，根据参数模糊查询
     *
     * @param param
     * @param areaArr
     * @return
     */
    List<TimeRule> selectAllByParam(@Param("param") String param, @Param("areaArr") String[] areaArr);

    /**
     * 根据企业ID删除此企业下所有的时间规则
     *
     * @param enterprise
     * @return
     */
    int deleteByEnterprise(@Param("enterprise") Integer enterprise);

    /**
     * 根据企业ID查询企业下的时间规则
     *
     * @param enterprise
     * @return
     */
    List<TimeRule> selectAllByEnterprise(@Param("enterprise") Integer enterprise);

    /**
     * 根据周几和企业ID去查询规则
     *
     * @param week
     * @param enterprise
     * @return
     */
    List<TimeRule> selectWeekTime(@Param("week") String week, @Param("enterprise") Integer enterprise);

    List<EnterpriseTimeRule> getEnterpriseTimeRule(OrganizationInfo organizationInfo);
    List<TimeRule> getByEnterpriseId(@Param("enterpriseId") int enterpriseId);
}